<?php
    
    include("sessiontest.php");
  
    include("classes/xmlrpc.inc.php");
    include("classes/rtorrent.cls.php");
    include("classes/torrent.cls.php");
  
    $rTorrent = new rTorrent();
    $torrent = $rTorrent->getTorrent($_GET["hash"]);
?>
<div id="details" title="Details" class="panel">
  <h2><?= $torrent->getName() ?></h2>
  <fieldset>
    <div class="row">
      <label>Done</label>
      <span><?= $torrent->getDownloaded() . " of " . $torrent->getSize() . " (" . $torrent->getPercentage() . "%)" ?></span>
    </div>
    <div class="row">
      <label>Download</label>
      <span><?= $torrent->getDownloadRate() ?></span>
    </div>
    <div class="row">
      <label>Upload</label>
      <span><?= $torrent->getUploadRate() ?></span>
    </div>
    <div class="row">
      <label>Seeds</label>
      <span><?= $torrent->getSeeds() ?></span>
    </div>
    <div class="row">
      <label>Peers</label>
      <span><?= $torrent->getPeers() ?></span>
    </div>
    <div class="row">
      <label>Ratio</label>
      <span><?= $torrent->getRatio() ?></span>
    </div>
  </fieldset>
  
  <fieldset>
    <div class="row">
      <a href="#actions" class="command">Actions</a>
    </div>
  </fieldset>
</div>

<div id="actions" class="dialog">
  <fieldset>
    <h1>Actions</h1>
    <a href="#details" class="whiteButton">Start</a>
    <a href="#details" class="whiteButton">Stop</a>
    <a href="#details" class="whiteButton">Close</a>
    <a href="#details" class="whiteButton">Erase</a>
    <a href="#details" class="whiteButton">Recheck Hash</a>
  </fieldset>
</div>